/*
 * triangle.h
 *
 *      Author: Jerome RD Soine and Christoph A Brand
 *      Institution: Schwarz goup, Institute for Theoretical Physics, Heidelberg University, Germany
 */

#ifndef TRIANGLE_H
#define TRIANGLE_H

#include "vertex.h"
#include "edge.h"
#include <vector>
#include <string>

class Triangle
  {
  private:
    vector<Vertex*> tips;
    vector<Edge*> edges;
    int index;

  public:
    Triangle(Vertex* v1, Vertex* v2, Vertex* v3, Edge* e1, Edge* e2, Edge* e3);

    vector<Edge*>* getEdges() { return &edges; };
    vector<Vertex*>* getTips() { return &tips; };
    int getIndex() {return index; };

    string toString();

    Vertex normal();
    Vertex normalizedNormal();

    Vertex * getThirdTip(Edge * firstAndSecondTip);
    Edge * getEdgeNotConnectedToTip(Vertex & v);
    Vertex constructEdgeNotConnectedToTipWithOrientation(Vertex & tip);
    bool hasTip(Vertex * v);

    double area();
    double volumeContribution();

    };

#endif // TRIANGLE_H
